bitkeeper revision 1.1407 (42851a62m3iGb_ScYjvXzomQNk1N4Q)
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 13 May 2005 21:21:38 +0000 (21:21 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 13 May 2005 21:21:38 +0000 (21:21 +0000)
desc.h, process.c:
  [PATCH] Fixing TLS handling in x86-64 xenlinux
  Some LTP testcases (pthreads) have exposed this bug (kill the kernel),
  and the attached fixes the problem. With this, pth_str0? run fine, for
  example. We'll continue to run LTP on x86-64 xenlinux to get all of them
  pass.
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c
linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h

index a2e3c1f54e137e935a96b052c38606c81a9c2efa..263176f6b508a7eb271f14d4fd2a4f317ca4bdef 100644 (file)
@@ -247,6 +247,7 @@ static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr)
        struct user_desc ud = { 
                .base_addr = addr,
                .limit = 0xfffff,
+               .contents = (3 << 3), /* user */
                .seg_32bit = 1,
                .limit_in_pages = 1,
                .useable = 1,
@@ -401,8 +402,7 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
                mcl->op      = __HYPERVISOR_update_descriptor;          \
                mcl->args[0] = virt_to_machine(&get_cpu_gdt_table(cpu)  \
                                               [GDT_ENTRY_TLS_MIN + i]); \
-               mcl->args[1] = (unsigned long) ((u64 *) &next->tls_array[i]); \
-               mcl->args[2] = (unsigned long) ((u64 *) &next->tls_array[i]); \
+               mcl->args[1] = next->tls_array[i];                      \
                mcl++;                                                  \
        }                                                               \
 } while (0)
index dcc51d667d07834b9503d03cfc5cc9d03608a825..15a10a135d3c50ac322328d691e25a8ea97f7707 100644 (file)
@@ -65,9 +65,9 @@ struct desc_ptr {
 
 extern struct desc_ptr idt_descr, cpu_gdt_descr[NR_CPUS];
 
-extern struct desc_ptr cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
+extern struct desc_struct cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
 
-#define get_cpu_gdt_table(_cpu) ((struct desc_ptr *)(cpu_gdt_descr[(_cpu)].address))
+#define get_cpu_gdt_table(_cpu) ((struct desc_struct *)(cpu_gdt_descr[(_cpu)].address))
 
 #define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
 #define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))